import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:easy_video/controller/video/collect_controller.dart';
import 'package:easy_video/widgets/auto_image_widget.dart';

class CollectView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetBuilder(
      builder: (controller) {
        return Scaffold(
          appBar: AppBar(
            title: Text(
              "收藏",
            ),
          ),
          // body: SingleChildScrollView(
          //   child: Column(
          //     children: List.generate(
          //       10,
          //       (index) {
          //         return _item();
          //       },
          //     ),
          //   ),
          // ),
          body: Center(
            child: Text(
              "即将上线",
            ),
          ),
        );
      },
      init: CollectController(),
    );
  }
}

class _item extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 200,
      width: Get.width,
      margin: EdgeInsets.only(
        top: 10,
        bottom: 10,
        left: 20,
        right: 20,
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(15),
        image: DecorationImage(
          fit: BoxFit.cover,
          image: AutoImage.buildImageProvider(
            "",
          ),
        ),
      ),
      child: Stack(
        children: [
          Positioned(
            bottom: 20,
            left: 20,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  "official japanese",
                  style: TextStyle(
                    color: Colors.white,
                  ),
                ),
                Text(
                  "A Whisker Away",
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 20,
                  ),
                ),
              ],
            ),
          ),
          Positioned(
            child: IconButton(
              style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.black.withOpacity(0.1),
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10),
                  )),
              onPressed: () {},
              icon: Icon(
                Icons.favorite,
                color: Colors.white,
              ),
            ),
            right: 5,
            top: 5,
          ),
        ],
      ),
    );
  }
}
